#
# pH+
#

#require 'phplus/core'
require 'ph/ui/container'

module Ph

  class Head < Ph::Container
  
    attr_accessor :title
    attr_reader :base
  
    def initialize
    
      super()
      @tag = 'head'
      
      @body.add @base = Ph::Tag.new('base')
      
      @properties.delete :id
      @properties.delete :class_name
      
      @base.properties[:href]   = Ph::Property.new('href', '')
      @base.properties[:target] = Ph::Property.new('target')      
                      
    end

		def target
			@base.properties[:target].value
		end

		def target=(what)
			@base.properties[:target].value = what
		end

		def href
			@base.properties[:href].value
		end

		def href=(what)
			@base.properties[:href].value = what
		end
    
    def to_s
			@body.add "<title>#@title</title>\n" if @title
			super
    end
  
  end
  
end
